cucDefine(['common'], function(common){
    let {loadScript, loadStyle, commonInit} = common;

    class LAY extends HTMLElement {
        constructor() {
            super();
            if(this.hasAttribute("labelname") && this.hasAttribute("identify")){
                let identify = this.getAttribute("identify");
                let labelname = this.getAttribute("labelname");
                let value = this.getAttribute("value");
                let div = document.createElement("div");
                div.className = "layui-inline control-group row-fluid";
                div.innerHTML = `<div class="layui-input-inline span12">
                    <label for="${identify}">${labelname}</label>
                    <input type="text" class="layui-input span12" id="${identify}" placeholder="yyyy-MM-dd HH:mm:ss" ${value?"value=\""+value+"\"":""}>
                </div>`
                this.appendChild(div);
                let script = document.createElement("script");
                script.innerHTML = `layui.use('laydate', function(){
                    var laydate = layui.laydate;
                    laydate.render({
                    elem: '#${identify}'
                    ,type: 'datetime'
                    });
                });`;
                this.appendChild(script);
            };
        }
    }
    return LAY;
});